import request from '@/libs/request'

export function index() {
    return request({
        url: '/sys/be-menu/default/index',
        method: 'get',
    })
}

export function edit(id, data) {
    return request({
        url: id !== undefined ? '/sys/be-menu/default/edit?id=' + id : '/sys/be-menu/default/edit',
        method: 'post',
        data: data,
    })
}

export function editSort(id, data) {
    return request({
        url: '/sys/be-menu/default/edit?id=' + id,
        method: 'post',
        data: data,
    })
}

export function setAvailable(status, data) {
    return request({
        url: '/sys/be-menu/default/available?status=' + status,
        method: 'post',
        data: data,
    })
}

export function getModel(data) {
    return request({
        url: '/sys/be-menu/default/edit',
        method: 'get',
        params: data,
    })
}

export function remove(data) {
    return request({
        url: '/sys/be-menu/default/delete',
        method: 'post',
        data: data,
    })
}
